<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        a{color:#000;}
        .icon {
            display: inline-block;
            width: 16px; height: 20px;
            background-image: url(sprite_icons.png);
            background-color: currentColor; /* 该颜色控制图标的颜色 */
        }
        .icon1 { background-position: 0 0; }
        .icon2 { background-position: -20px 0; }
        .icon3 { background-position: -40px 0; }
        .icon4 { background-position: -60px 0; }
        .link { margin-right: 15px; }
        .link:hover{color: #333;}
    </style>
</head>
<body>
更改颜色：<input id="colorInput" type="color" value="#34538b" autocomplete="off">
<p>
    <a href="##" class="link"><i class="icon icon1"></i>返回</a>
    <a href="##" class="link"><i class="icon icon2"></i>刷新</a>
    <a href="##" class="link"><i class="icon icon3"></i>收藏</a>
    <a href="##" class="link"><i class="icon icon4"></i>展开图片</a>
</p>

<script>
    var eleInput = document.getElementById("colorInput"),
            eleIcons = document.getElementsByTagName("i");
    eleInput.onchange = function() {
        var i = 0, l = eleIcons.length;
        for (; i<l; i+=1) {
            eleIcons[i].style.backgroundColor = this.value;
        }
    };
</script>
</body>
</html>